<!--{*
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
*}-->
<style type="text/css">
    div.dragged_elm {
        position:   absolute;
        border:     1px solid black;
        background: rgb(195,217,255);
        color:      #333;
        cursor:		move;
        PADDING-RIGHT: 	2px;
        PADDING-LEFT: 	2px;
        PADDING-BOTTOM: 5px;
        PADDING-TOP: 	5px;
        FONT-SIZE: 		10pt;
    }

    div.drop_target {
        border:      0px solid gray;
        position:    relative;
        text-align:  center;
        color:       #333;
    }

</style>
<script type="text/javascript">

function doPreview(){
	document.form1.mode.value="preview"
	document.form1.target = "_blank";
	document.form1.submit();
}
function fnTargetSelf(){
	document.form1.target = "_self";
}

// 初期処理
function init () {
    document.body.ondrag = function () { return false; };
    document.body.onselectstart = function () { return false; };

    // ウィンドウサイズを取得
	scrX = GetWindowSize("width");
	scrY = GetWindowSize("height");

	// ウィンドウサイズ変更イベントに関連付け
    window.onresize = fnMoveObject;

    // divタグを取得
    all_elms = document.getElementsByTagName ( 'div' );

	// tdタグを取得
	all_td = document.getElementsByTagName ( 'td' );

	// 配列作成
	fnCreateArr(0);

	// alerttest(0);

    // 並び替え
	fnMoveObject();

	<!--{$complate_msg}-->
}

</script>
<script type="text/javascript" src="<!--{$TPL_DIR}-->js/layout_design.js"></script>

<div id="alpha">
<div id="alpha-inner">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</div>
</div>



<div id="beta">
<div id="beta-inner">
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->" >
<input type="hidden" name="mode" value="">
<input type="hidden" name="page_id" value="<!--{$page_id}-->">
<input type="hidden" name="bloc_cnt" value="<!--{$bloc_cnt}-->">

<div class="title_page">
<h2><!--{$tpl_subtitle}--></h2>
</div>



<div class="layout-box">


	<div class="layout-box_left">
	<h3>レイアウト編集</h3>

	<div class="nodata2"><p>ヘッダー部</p></div>

		<!--▼レイアウト　ここから-->
		<div class="menuclass">
		<table summary="レイアウト設定">
		<tr><!-- ★☆★ 左ナビテーブル ☆★☆ -->
			<td align="center" valign="top">
				<div id="layout" class="layout-left">
				<div tid="LeftNavi" class="drop_target" id="t1" style="width: 145px; height: 100px;"></div>
				</div>
			</td>

				<!-- ★☆★ 左ナビテーブル ☆★☆ -->
				<td align="center" valign="top">
				<div id="layout" name='MainHead' class="layout-center-top">
				<div tid="MainHead" class="drop_target" id="t2" style="width: 145px; height: 100px;"></div>
				</div>

					<!-- ★☆★ メイン上部テーブル ☆★☆ -->
					<!-- ★☆★ メイン ☆★☆ -->
					<div class="nodata2">
					<p name='Main'>メイン</p>
					</div>

						<!-- ★☆★ メイン下部テーブル ☆★☆ -->
						<div class="block">
						<div id="layout" name="MainFoot" class="layout-center-bottom">
						<div tid="MainFoot" class="drop_target" id="t4" style="width: 145px; height: 100px;"></div>
						</div>
						</div>
				</td>

					<!-- ★☆★ 右ナビテーブル ☆★☆ -->
					<td align="center" valign="top">
					<div tid="RightNavi" class="drop_target" id="t3" style="width: 145px; height: 100px;"></div>
					</td>
		</tr>
		</table>
		</div>
		<!--▲レイアウト　ここまで-->

	<div class="nodata2"><p>フッター部</p></div>
	<!-- /layout-box_left --></div>



	<div class="layout-box_right">
	<h3>未使用ブロック</h3>

	<!--▼未使用ブロック　ここから-->
	<div tid="Unused" class="drop_target" id="t5" style="width: 160px; height: 500px; border: 1px solid #cccccc;"></div>
	<p class="place-center">
	<input type='button' value='新規ブロック作成' name='subm' onclick="fnTargetSelf(); fnFormModeSubmit('form1','new_bloc','','');" />
	</p>
	<!--▲未使用ブロック　ここまで-->

	<!-- /layout-box_right --></div>


	<div class="btn_box">
	<input type='button' value='保存' name='subm' onclick="fnTargetSelf(); fnFormModeSubmit('form1','confirm','','');" />
	<input type='button' value='プレビュー' name='preview' onclick="doPreview();" <!--{if $page_id == "0" or $exists_page == "0" }-->DISABLED<!--{/if}--> />
	</div>

</div>
<!-- layout-box end -->
<!--▲レイアウト編集　ここまで-->





<!--▼ページ一覧　ここから-->
<h3>編集可能ページ</h3>

<div class="menuclass">
<table summary="編集可能ページ">
<!--{foreach key=key item=item from=$arrEditPage}-->
<tr>
	<td align="center" bgcolor="<!--{if $item.page_id == $page_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->">
	<a href="<!--{$smarty.server.PHP_SELF|escape}-->?page_id=<!--{$item.page_id}-->" ><!--{$item.page_name}--></a>
	</td>
	<td align="center" bgcolor="<!--{if $item.page_id == $page_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->">
	<input type='button' value='メイン編集' name='page_edit' onclick="location.href='./main_edit.php?page_id=<!--{$item.page_id}-->'" />
	</td>
	<td align="center" bgcolor="<!--{if $item.page_id == $page_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->">
	<!--{if $item.edit_flg == 1}-->
	<input type='button' value='削除' name='del' onclick="fnTargetSelf(); fnFormModeSubmit('form1','delete','','');" />
	<!--{/if}-->
	</td>
	</tr>
<!--{/foreach}-->
</table>

<div class="btn_box">
<input type='button' value='新規ページ作成' name='subm' onclick="fnTargetSelf(); fnFormModeSubmit('form1','new_page','','');" />
</div>

</div>
<!--▲ページ一覧　ここまで-->



<!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
<div align=center target_id="<!--{$item.target_id}-->" did="<!--{$smarty.foreach.bloc_loop.iteration}-->" class="dragged_elm" id="<!--{$item.target_id}-->"
	 style="left:350px; top:0px; filter: alpha(opacity=100); opacity: 1; width: 120px;">
	 <!--{$item.name}-->
</div>

<input type="hidden" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->">
<input type="hidden" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->">
<input type="hidden" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->">
<input type="hidden" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->">
<!--{/foreach}-->
</form>
</div>
</div>
